import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '是否删除',
    align:"center",
    dataIndex: 'trash'
   },
   {
    title: '领队状态',
    align:"center",
    dataIndex: 'leaderstats'
   },
   {
    title: '车辆状态',
    align:"center",
    dataIndex: 'carstats'
   },
   {
    title: '旅游拼团ID',
    align:"center",
    dataIndex: 'travelgroupid'
   },
   {
    title: '车辆ID',
    align:"center",
    dataIndex: 'carid'
   },
   {
    title: '绑定的领队ID',
    align:"center",
    dataIndex: 'bindleaderid'
   },
   {
    title: '创建时间',
    align:"center",
    dataIndex: 'createtime'
   },
   {
    title: '车辆绑定上车点',
    align:"center",
    dataIndex: 'bindstartpoint'
   },
   {
    title: '可载游客总人数',
    align:"center",
    dataIndex: 'totaltournum'
   },
   {
    title: '其他信息',
    align:"center",
    dataIndex: 'extinfor'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '是否删除',
    field: 'trash',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入是否删除!'},
          ];
     },
  },
  {
    label: '领队状态',
    field: 'leaderstats',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入领队状态!'},
          ];
     },
  },
  {
    label: '车辆状态',
    field: 'carstats',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入车辆状态!'},
          ];
     },
  },
  {
    label: '旅游拼团ID',
    field: 'travelgroupid',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入旅游拼团ID!'},
          ];
     },
  },
  {
    label: '车辆ID',
    field: 'carid',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入车辆ID!'},
          ];
     },
  },
  {
    label: '绑定的领队ID',
    field: 'bindleaderid',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入绑定的领队ID!'},
          ];
     },
  },
  {
    label: '创建时间',
    field: 'createtime',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入创建时间!'},
          ];
     },
  },
  {
    label: '车辆绑定上车点',
    field: 'bindstartpoint',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入车辆绑定上车点!'},
          ];
     },
  },
  {
    label: '可载游客总人数',
    field: 'totaltournum',
    component: 'InputNumber',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入可载游客总人数!'},
          ];
     },
  },
  {
    label: '其他信息',
    field: 'extinfor',
    component: 'InputTextArea',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入其他信息!'},
          ];
     },
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];



/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}